home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / falcon / nt_dsp1.lzh / NT_DSP1.MSA / FLTS / FIR.HLP < prev    next >
Encoding:
Text File  |  1989-01-24  |  2.2 KB  |  69 lines

  1. 2 FIR
  2.          Name: FIR.ASM
  3.          Type: Assembler Macro
  4.       Version: 1.0
  5.  Date Entered:  15-Jul-87
  6.   Last Change:  15-Jul-87
  7.  
  8.   Description: Direct Form FIR Filter Assembler Macro
  9.  
  10.  This macro implements a direct form FIR filter with an arbitrary
  11.  number of coefficient taps.  The difference equation for a four
  12.  tap filter is shown below:
  13.  
  14.        y(n)= b(0)x(n) + b(1)x(n-1) + b(2)x(n-1) + b(3)x(n-3)
  15.  
  16.  with z transform:
  17.  
  18.        Y(z)               -1         -2           -3
  19.       ----- = b(0) + b(1)z    + b(2)z      + b(3)z
  20.        X(z)
  21.  
  22.  where:
  23.       x(n) = input sample at time nT
  24.       y(n) = output sample at time nT
  25.       T    = sampling period
  26.       b(n) = filter impulse response at time nT
  27.  
  28.  This difference equation can be implemented  with  the  discrete
  29.  time filter structure shown:
  30.  
  31.       Input
  32.     x(n) >-----------1/z---------1/z---------1/z-------
  33.                 |           |           |             |
  34.                0.1         0.3        -0.1           0.2
  35.              b(0) \    b(1) |      b(2) |       b(3) /
  36.                    \        \___     ___/           /
  37.                     \           \   /              /
  38.                      ----------->(+)<--------------
  39.                                   |-----------------> y(n) Output
  40.                              
  41.  
  42.   The coefficients in the example are arbitrary.  For the
  43.   above filter, the  memory  map  for  the  filter states
  44.   (past input samples) and coefficients (b) are shown below.
  45.  
  46.  
  47.            r0         m0=ntaps-1   (=3, mod 4)
  48.            |
  49.            v
  50.        ---------------------------------------
  51.   X:   |  New   |   Old   |   Old   |   Old  | Filter States
  52.        | x(n)   | x(n-1)  | x(n-2)  | x(n-3) |
  53.        ---------------------------------------
  54.  
  55.        ---------------------------------------
  56.   Y:   |  b(0)  |   b(1)  |   b(2)  |  b(3)  | Filter Coefficients
  57.        |  .1    |   .3    |  -.1    |  .2    |
  58.        ---------------------------------------
  59.            ^
  60.            |
  61.            r4        m4=ntaps-1    (=3, mod 4)
  62.  
  63.                Memory Map for the FIR Filter
  64.  
  65.  
  66.  For an example of how to use the filter macro, see the test program
  67.  FIRT.ASM.
  68.  
  69.